#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,i,num;
	double t=0,x,y;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		cin>>x>>y>>num;
		t=t+sqrt(x*x+y*y)/50*2+num*1.5;
	}
	cout<<ceil(t);
    return 0;
}

